#include "ioc.h"

float temp_read()
{
    float raw, scale, offset;
    raw = strtod(read_file(TEMP_RAW), NULL);
    scale = strtod(read_file(TEMP_SCALE), NULL);
    offset = strtod(read_file(TEMP_OFFSET), NULL);

    return (raw + offset) * scale / 1000.0;
}

float hum_read()
{
    float raw, scale, offset;
    raw = strtod(read_file(HUM_RAW), NULL);
    scale = strtod(read_file(HUM_SCALE), NULL);
    offset = strtod(read_file(HUM_OFFSET), NULL);

    return (raw + offset) * scale / 1000.0;
}